home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / pc / files / watt.dir / 00269_Script_Watt BIY obj < prev    next >
Text File  |  1997-07-24  |  16KB  |  468 lines

  1. --o Watt BIY obj
  2.  
  3. --Instantiated as gWattBIYobj
  4.  
  5. property pCurrentCondensor, pCurrentCylinder, pQTplaying
  6. property pPlaceHolderCastNum, pPuppetSpriteList
  7. property pQTsprite, pEngineQTlocH, pEngineQTlocV, pCoalQTlocH, pCoalQTlocV
  8. property pCoalQTcast, pEngineQTBaseCast
  9.  
  10. property pCondensorSprite, pCondensorInUseSprite, pCondenseHSstartSprite
  11. property pCondensorLocH, pCondensorLocV, pCondensorInUseLocH, pCondensorInUseLocV
  12.  
  13. property pCondensorIUBaseCastNum, pCondensorBaseCastNum
  14. property pCylinderSprite, pCylinderInUseSprite, pCylinderHSstartSprite
  15. property pCylinderInUseLocH, pCylinderInUseLocV, pCylinderLocH, pCylinderLocV
  16. property pCylinderInUseBaseCast, pCylinderBaseCast
  17. property pStokeHSsprite, pTestStage, pDisplayingQT
  18. property pFeedbackAIFfileList, pIntroSndFileName, pResultsArray
  19. property pAttemptCounter, pVictoryQTbaseCast, pVictoryQTlocH, pVictoryQTlocV
  20. property pQTsizeAdjusterDataList, pEngineQTlocH2, pEngineQTlocV2
  21. property pTestRecord, pCorrectX, pCorrectY       --JOURNAL
  22. property pCursorPropList, pCursorList
  23. property  pCondensorSndCastNum, pCylinderSndCastNum
  24.  
  25. property pWBYSlabels
  26. property pRolloverStartsprite
  27. property pRolloverEndSprite
  28.  
  29. global gJournalObj, gScoreEventObj, gUtilityObj, gSndPath, gActiveAmbSnd    --JOURNAL
  30. -------------------------------------------------------<<ò>>
  31. on mInit me
  32.   
  33.   cursor 4
  34.   set pIntroSndFileName = "WEEINTR.AIF"
  35.   sound playfile 2, gSndPath & pIntroSndFileName
  36.   updatestage
  37.   
  38.   set pPuppetSpriteList = []
  39.   set pPlaceHolderCastNum = the number of cast "Watt BIY placeHolder"
  40.   set pFeedbackAIFfileList = ["WEEHNT1.AIF", "WEEHNT2.AIF", "WEEHNT3.AIF", "WEEHNT4.AIF", "WEEHNT5.AIF"]
  41.   set pAttemptCounter = 0
  42.   
  43.   set pResultsArray = []
  44.   append pResultsArray,[2,4,1,3,1,1]
  45.   append pResultsArray,[2,4,5,3,1,1]
  46.   append pResultsArray,[2,3,4,3,#Win,4]
  47.   set pCorrectX = 3
  48.   set pCorrectY = 5
  49.   
  50.   set pQTsizeAdjusterDataList = [1,1,1,1,1,1,2,2,2,1,1,1,2,2,2,2,2,2]
  51.   set pTestRecord = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]     --JOURNAL
  52.   
  53.   
  54.   
  55.   set pQTsprite = 6
  56.   add pPuppetSpriteList, pQTsprite
  57.   set pEngineQTlocH = 238
  58.   set pEngineQTlocV = 250
  59.   set pEngineQTlocH2 = 238
  60.   set pEngineQTlocV2 = 247
  61.   set pEngineQTBaseCast = the number of cast "WEECYL1A.MOV"
  62.   set pCoalQTlocH = 364
  63.   set pCoalQTlocV = 368
  64.   set pCoalQTcast = the number of cast "WEECOAL.MOV"
  65.   set pVictoryQTlocH = 354
  66.   set pVictoryQTlocV = 290
  67.   set pVictoryQTbaseCast = the number of cast "WEEVID1.MOV"
  68.   
  69.   set pCylinderSprite = 4
  70.   add pPuppetSpriteList, pCylinderSprite
  71.   set pCylinderLocH = 173
  72.   set pCylinderLocV = 348
  73.   set pCylinderBaseCast = the number of cast "WEECYLN1.PIC"
  74.   
  75.   set pCylinderInUseSprite = 3
  76.   add pPuppetSpriteList, pCylinderInUseSprite
  77.   set pCylinderInUseLocH = 256
  78.   set pCylinderInUseLocV = 152
  79.   set pCylinderInUseBaseCast = the number of cast "WEECYL1.PIC"
  80.   
  81.   set pCondensorSprite = 5
  82.   add pPuppetSpriteList, pCondensorSprite
  83.   set pCondensorLocH = 95
  84.   set pCondensorLocV = 344
  85.   set pCondensorBaseCastNum = the number of cast "WEECNDN1.PIC"
  86.   
  87.   set pCondensorInUseSprite = 7
  88.   add pPuppetSpriteList, pCondensorInUseSprite
  89.   set pCondensorInUseLocH = 142
  90.   set pCondensorInUseLocV = 203
  91.   set pCondensorIUBaseCastNum = the number of cast "WEECOND1.PIC"
  92.   
  93.   set pCondenseHSstartSprite = 8
  94.   add pPuppetSpriteList, pCondenseHSstartSprite
  95.   add pPuppetSpriteList, pCondenseHSstartSprite + 1
  96.   add pPuppetSpriteList, pCondenseHSstartSprite + 2
  97.   
  98.   set pCylinderHSstartSprite = 11
  99.   repeat with CurrentSprite = pCylinderHSstartSprite to pCylinderHSstartSprite + 5
  100.     add pPuppetSpriteList, CurrentSprite
  101.   end repeat
  102.   
  103.   set pStokeHSsprite = 17
  104.   add pPuppetSpriteList, pStokeHSsprite
  105.   
  106.   --SOUNDS
  107.   set pCondensorSndCastNum = the number of cast  "WEECOND.AIFF"
  108.   set pCylinderSndCastNum = the number of cast "WEECYL.AIFF"
  109.   
  110.   --CURSORS
  111.   set pCursorList = []
  112.   repeat with SpritetoAdd = pCondenseHSstartSprite to pCondenseHSstartSprite + 2
  113.     add (pCursorList, SpritetoAdd)
  114.   end repeat
  115.   repeat with SpriteToAdd = pCylinderHSstartSprite to pCylinderHSstartSprite + 5
  116.     add (pCursorList, SpritetoAdd)
  117.   end repeat
  118.   add (pCursorList, pStokeHSsprite)
  119.   set pCursorPropList = [:]
  120.   repeat with CurrentCursor in pCursorList
  121.     addProp (pCursorPropList, CurrentCursor, #Operate)
  122.   end repeat
  123.   setprop( pCursorPropList, pStokeHSsprite,#shovel)
  124.   
  125.   set pWBYSlabels = the text of cast "WBYSlabels"
  126.   set pRolloverStartsprite = 8
  127.   set pRolloverEndSprite = 17
  128.   
  129.   set gActiveAmbSnd = 0
  130.   
  131.   return me
  132.   
  133. end mInit
  134. -------------------------------------------------------<<ò>>
  135. on mActivate me
  136.   
  137.   
  138.   set pCurrentCondensor = 0    --0 to 3 (0 is none selected)
  139.   set pCurrentCylinder = 0     --0 to 6 (0 is none selected)
  140.   set pQTplaying = false
  141.   set pDisplayingQT = false
  142.   set pTestStage = 0
  143.   
  144.   mSetCursors(gUtilityObj, pCursorPropList)
  145.   repeat with whichSprite in pPuppetSpriteList
  146.     puppetSprite whichSprite, true
  147.   end repeat
  148.   
  149.   mInformJournal(gJournalObj, #ArrivingAtBIY)   --JOURNAL
  150.   mSetToolBtns (gInterfaceMgrObj, #WBYS, me)
  151.   
  152.   cursor - 1
  153.   
  154. end mActivate
  155. -------------------------------------------------------<<ò>>
  156.  
  157. -------------------------------------------------------------------------------------------------------------------
  158. -- dont pay attetion to lingering highlights ... just functionality
  159. -------------------------------------------------------------------------------------------------------------------
  160. on mOperate me, whatSelection
  161.   
  162.   
  163.   if WhatSelection = 1 then
  164.     --PREVIOUS CONDENSOR
  165.     if pCurrentCondensor < 2 then set NewCondensor = 3
  166.     else set NewCondensor = pCurrentCondensor - 1
  167.     set SimulatedClickNum = NewCondensor + pCondenseHSstartSprite - 1
  168.     mCondensorClick(me, SimulatedClickNum)
  169.   else if WhatSelection = 2 then
  170.     --PREVIOUS CYLINDER
  171.     if pCurrentCylinder < 2 then set NewCylinder = 6
  172.     else set NewCylinder = pCurrentCylinder - 1
  173.     set SimulatedClickNum = NewCylinder + pCylinderHSstartSprite - 1
  174.     mCylinderClick(me, SimulatedClickNum)
  175.   else if WhatSelection = 3 then
  176.     --NEXT CONDENSOR
  177.     if pCurrentCondensor > 2 then set NewCondensor = 1
  178.     else set NewCondensor = pCurrentCondensor + 1
  179.     set SimulatedClickNum = NewCondensor + pCondenseHSstartSprite - 1
  180.     mCondensorClick(me, SimulatedClickNum)
  181.   else if WhatSelection = 4 then
  182.     --NEXT CYLINDER
  183.     if pCurrentCylinder > 5 then set NewCylinder = 1
  184.     else set NewCylinder = pCurrentCylinder + 1
  185.     set SimulatedClickNum = NewCylinder + pCylinderHSstartSprite - 1
  186.     mCylinderClick(me, SimulatedClickNum)
  187.   else if WhatSelection = 5 then
  188.     --STOKE BOILER
  189.     mEngineStage1(me)
  190.   end if
  191.   mClearToolHilite ( gInterfaceMgrObj )
  192.   
  193. end mOperate
  194. ----------------------------------------------------------------------------------------------------
  195. on mClose me
  196.   
  197.   mUnsetCursorList(gUtilityObj, pCursorList)
  198.   
  199.   repeat with whichSprite in pPuppetSpriteList
  200.     puppetSprite whichSprite, false
  201.   end repeat
  202.   if soundBusy(2) then sound stop 2
  203.   mInformJournal(gJournalObj, #LeavingBIY)   --JOURNAL
  204.   
  205. end mClose
  206. -------------------------------------------------------<<ò>>
  207. on mBIYclickEvent me
  208.   
  209.   if soundBusy(2) then sound stop 2
  210.   
  211.   if not pQTplaying then     -- <-- lock out all click events while QT playing
  212.     if pDisplayingQT then mHideQT(me)
  213.     set HSclicked = the clickon
  214.     if (HSclicked > pCondenseHSstartSprite - 1) and (HSclicked < pCondenseHSstartSprite + 3) then
  215.       mCondensorClick(me, HSclicked)
  216.     else if (HSclicked > pCylinderHSstartSprite - 1) and (HSclicked < pCylinderHSstartSprite + 6) then
  217.       mCylinderClick(me, HSclicked)
  218.     else if HSclicked = pStokeHSsprite then
  219.       mEngineStage1(me)
  220.     end if
  221.   end if
  222.   
  223. end mBIYclickEvent
  224. -------------------------------------------------------<<ò>>
  225. on mCondensorClick me, argHSclicked
  226.   
  227.   set ClickIndex = argHSclicked - pCondenseHSstartSprite
  228.   if pCurrentCondensor <> ClickIndex + 1 then puppetSound 2, pCondensorSndCastNum
  229.   set the castNum of sprite pCondensorInUseSprite = pCondensorIUBaseCastNum + ClickIndex
  230.   set the locH of sprite pCondensorInUseSprite = pCondensorInUseLocH
  231.   set the locV of sprite pCondensorInUseSprite = pCondensorInUseLocV
  232.   
  233.   set the castNum of sprite pCondensorSprite = pCondensorBaseCastNum + ClickIndex
  234.   set the locH of sprite pCondensorSprite = pCondensorLocH
  235.   set the locV of sprite pCondensorSprite = pCondensorLocV
  236.   
  237.   set pCurrentCondensor = ClickIndex + 1
  238.   updateStage
  239.   
  240. end mCondensorClick
  241. -------------------------------------------------------<<ò>>
  242. on mCylinderClick me, argHSclicked
  243.   
  244.   set ClickIndex = argHSclicked - pCylinderHSstartSprite
  245.   if pCurrentCylinder <> ClickIndex + 1 then puppetSound 2, pCylinderSndCastNum
  246.   set the castNum of sprite pCylinderInUseSprite = pCylinderInUseBaseCast + ClickIndex
  247.   set the locH of sprite pCylinderInUseSprite = pCylinderInUseLocH
  248.   set the locV of sprite pCylinderInUseSprite = pCylinderInUseLocV
  249.   
  250.   set the castNum of sprite pCylinderSprite = pCylinderBaseCast + ClickIndex
  251.   set the locH of sprite pCylinderSprite = pCylinderLocH
  252.   set the locV of sprite pCylinderSprite = pCylinderLocV
  253.   
  254.   set pCurrentCylinder = ClickIndex + 1
  255.   updateStage
  256.   
  257. end mCylinderClick
  258. -------------------------------------------------------<<ò>>
  259. on mHideQT me
  260.   
  261.   if pDisplayingQT then
  262.     set the visible of sprite pQTsprite = 0
  263.     set pQTplaying = false
  264.     set pDisplayingQT = false
  265.     set the castNum of sprite pQTsprite = pPlaceHolderCastNum
  266.     set the locH of sprite pQTsprite = -300
  267.     set the visible of sprite pQTsprite = 1
  268.     updateStage
  269.   end if
  270.   
  271. end mHideQT
  272. -------------------------------------------------------<<ò>>
  273. on mEngineStage1 me                 --Initiate Stage 1
  274.   
  275.   if pCurrentCondensor <> 0 and pCurrentCylinder <> 0 then
  276.     sound stop 1
  277.     set pAttemptCounter = pAttemptCounter + 1
  278.     set pQTplaying = true
  279.     set pDisplayingQT = true
  280.     set pTestStage = 1
  281.     set the castNum of sprite pQTsprite = pCoalQTcast
  282.     set the locH of sprite pQTsprite = pCoalQTlocH
  283.     set the locV of sprite pQTsprite = pCoalQTlocV
  284.     updateStage
  285.     set the movierate of sprite pQTsprite = 1
  286.   end if
  287.   
  288. end mEngineStage1
  289. -------------------------------------------------------<<ò>>
  290. on mEngineStage2 me              --Initiate Stage 2
  291.   
  292.   mRedraw me
  293.   set pTestStage = 2
  294.   set EngineIndex = ((pCurrentCylinder - 1) * 3 + pCurrentCondensor) - 1
  295.   setAt(pTestRecord, (EngineIndex + 1), 1)   --JOURNAL
  296.   set QTadjusterType = getAt(pQTsizeAdjusterDataList, (EngineIndex + 1))
  297.   set the castNum of sprite pQTsprite = pEngineQTBaseCast + EngineIndex
  298.   if QTadjusterType = 1 then
  299.     set the locH of sprite pQTsprite = pEngineQTlocH
  300.     set the locV of sprite pQTsprite = pEngineQTlocV
  301.   else if QTadjusterType = 2 then
  302.     set the locH of sprite pQTsprite = pEngineQTlocH2
  303.     set the locV of sprite pQTsprite = pEngineQTlocV2
  304.   end if
  305.   sound stop 1
  306.   updateStage
  307.   set the movierate of sprite pQTsprite = 1
  308.   
  309. end mEngineStage2
  310. -------------------------------------------------------<<ò>>
  311. on mEngineStage3 me              --Initiate Stage 3
  312.   
  313.   set ExpResult = getAt(getAt(pResultsArray, pCurrentCondensor), pCurrentCylinder)
  314.   if ExpResult = #Win then
  315.     set pTestStage = 3
  316.     if pAttemptCounter < 7 then
  317.       set VictoryQTindex = 0
  318.     else if (pAttemptCounter > 6) and (pAttemptCounter < 14) then
  319.       set VictoryQTindex = 1
  320.     else if (pAttemptCounter  > 13) then
  321.       set VictoryQTindex = 2
  322.     end if
  323.     set pAttemptCounter = 0          --Design Issue:  Where does this go?
  324.     set the visible of sprite pQTsprite = 0
  325.     set the castNum of sprite pQTsprite = pVictoryQTbaseCast + VictoryQTindex
  326.     set the locH of sprite pQTsprite = pVictoryQTlocH
  327.     set the locV of sprite pQTsprite = pVictoryQTlocV
  328.     set the visible of sprite pQTsprite = 1
  329.   else
  330.     set pTestStage = 0
  331.     set pQTplaying = false
  332.     set SndToPlay = getAt(pFeedbackAIFfileList, ExpResult)
  333.     sound playfile 2, gSndPath & SndToPlay
  334.   end if
  335.   
  336. end mEngineStage3
  337. -------------------------------------------------------<<ò>>
  338. on mRedraw me
  339.   
  340.   set the locv of sprite pQTsprite = -1000
  341.   set the visible of sprite 24 = False
  342.   updatestage
  343.   set the visible of sprite 24 = True
  344.   
  345. end mRedraw
  346. -------------------------------------------------------<<ò>>
  347. on mEngineStage4 me
  348.   
  349.   set pTestStage = 0
  350.   set pQTplaying = false
  351.   mHideQT(me)
  352.   
  353. end mEngineStage4
  354. -------------------------------------------------------<<ò>>
  355. on mPerform me
  356.   
  357.   
  358.   if pQTplaying then
  359.     
  360.     if (the movieRate of sprite pQTsprite = 0) then
  361.       set gActiveAmbSnd = 0
  362.  
  363.       if pTestStage = 1 then mEngineStage2(me)
  364.       else if pTestStage = 2 then  mEngineStage3(me)        
  365.       else if pTestStage = 3 then  mEngineStage4(me)
  366.     end if
  367.     
  368.   else
  369.     
  370.     set spritetoCheck = pRolloverStartsprite
  371.     set found = FALSE
  372.     repeat while (not found) and (spritetoCheck <= pRolloverEndSprite)
  373.       if rollover(spritetoCheck) then
  374.         set labelText = line (spritetoCheck - pRolloverStartsprite + 1) of pWBYSlabels
  375.         mSetLabelText( gUtilityObj, labelText)
  376.         set found = TRUE
  377.       end if
  378.       set spritetoCheck = spritetoCheck + 1
  379.     end repeat
  380.     
  381.   end if
  382.   
  383.   go the frame
  384.   
  385.   
  386. end mPerform
  387. -------------------------------------------------------<<ò>>
  388. on mPullOutClickEvent me
  389.   
  390.   if mDiscloseJournalActive (gJournalObj) = true then
  391.     mClose(gJournalObj)
  392.   else
  393.     mclose( me )
  394.     mStopMovGoFrameAndPullOut( gScoreEventObj, 6,"Engine PO" )
  395.   end if
  396.   
  397. end mPullOutClickEvent
  398. -------------------------------------------------------<<ò>>
  399. --THE FOLLOWING METHODS ARE USED RELATE TO THE JOURNAL OBJECT
  400. -------------------------------------------------------<<ò>>
  401. on mDiscloseTestRecord me
  402.   
  403.   return(pTestRecord)
  404.   
  405. end mDiscloseTestRecord
  406. -------------------------------------------------------<<ò>>
  407. on mDiscloseCorrectX me
  408.   
  409.   return(pCorrectX)
  410.   
  411. end mDiscloseCorrectX
  412. -------------------------------------------------------<<ò>>
  413. on mDiscloseCorrectY me
  414.   
  415.   return(pCorrectY)
  416.   
  417. end mDiscloseCorrectY
  418. -------------------------------------------------------<<ò>>
  419. on mSwitchToJournal me
  420.   
  421.   mHideQT(me)
  422.   set the castnum of sprite 6 = 0
  423.   updatestage
  424.   set pTestStage = 0
  425.   
  426.   repeat with whichSprite in pPuppetSpriteList
  427.     set the castnum of sprite whichSprite = 0
  428.     puppetSprite whichSprite, false
  429.   end repeat
  430.   updateStage
  431.   
  432.   if soundBusy(2) then sound stop 2
  433.   mUnsetCursorList(gUtilityObj, pCursorList)
  434.   
  435. end mSwitchToJournal
  436. -------------------------------------------------------<<ò>>
  437. on mSwitchToBIY me
  438.   
  439.   set pCurrentCondensor = 0    --0 to 3
  440.   set pCurrentCylinder = 0     --0 to 6
  441.   set pQTplaying = false
  442.   set pDisplayingQT = false
  443.   set pTestStage = 0
  444.   
  445.   sort(pPuppetSpriteList)
  446.   repeat with whichSprite in pPuppetSpriteList
  447.     puppetSprite whichSprite, true
  448.   end repeat
  449.   go the frame
  450.   mSetCursors(gUtilityObj, pCursorPropList)
  451.   
  452. end mSwitchToBIY
  453. -------------------------------------------------------<<ò>>
  454. on mReviewExperiment me, argRowClicked, argCollumClicked
  455.   
  456.   updateStage
  457.   set pCurrentCondensor = argCollumClicked
  458.   set CondensorHotSpotEquivelent = pCondenseHSstartSprite + pCurrentCondensor - 1
  459.   mCondensorClick(me, CondensorHotSpotEquivelent)
  460.   
  461.   set pCurrentCylinder = argRowClicked
  462.   set CylinderHotSpotEquivelent = pCylinderHSstartSprite + pCurrentCylinder - 1
  463.   mCylinderClick(me, CylinderHotSpotEquivelent)
  464.   mEngineStage1(me)
  465.   
  466. end mReviewExperiment
  467. -------------------------------------------------------<<ò>>
  468.